Skip to content

[quality] cover mint projected-token loader and advisory file-path ref parsers - #5044

Merged
clubanderson merged 1 commit into
v4from
quality/test-mint-tokenreview-loader
Aug 29, 2026
Merged

[quality] cover mint projected-token loader and advisory file-path ref parsers#5044
clubanderson merged 1 commit into
v4from
quality/test-mint-tokenreview-loader

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds two test files, no production code changes:

  • src/pkg/mint/tokenreview_loader_test.go — covers readFileTrimmed (20% → 100%): token rotation re-read, whitespace trim, missing-file error propagation; and the CA-bundle branch of NewInClusterTokenReviewAuthenticator (50% → 87.5%), hermetic on both plain hosts and in-cluster pods.
  • src/pkg/advisory/filepathref_test.go — direct branch coverage for splitFilePathRef and isFilePathRef (50% → 100%): non-numeric colon suffix, trailing/leading colon, gh-N and repo#N refs.

Claimed ground

Files/functions: src/pkg/mint/tokenreview.go (readFileTrimmed, NewInClusterTokenReviewAuthenticator) and src/pkg/advisory/advisory.go (splitFilePathRef, isFilePathRef) — disjoint from open PRs #5036 (config.go provenance test) and #4032 (proxy auth injection).

Verification

go test ./pkg/mint/ ./pkg/advisory/ — ok, 94.4% / 94.6%.

Beads: 83e05ac8-728, fe21ab38-f60.


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5

…f parsers

readFileTrimmed (pkg/mint/tokenreview.go) was at 20%: the rotation
re-read, whitespace trim, and missing-file branches were untested even
though this loader is what keeps the mint authenticating itself after
the kubelet rotates the projected ServiceAccount token. Now 100%.

NewInClusterTokenReviewAuthenticator was at 50%: only the missing-env
refusal was covered. The CA-bundle branch is now tested hermetically on
both plain hosts (absent bundle must refuse, naming the CA) and real
pods (present bundle must construct without network I/O). Now 87.5%.

splitFilePathRef / isFilePathRef (pkg/advisory/advisory.go) were only
reached through the happy VerifyFindingPaths flow; edge branches
(non-numeric suffix, trailing/leading colon, gh-/#-refs) are now pinned
directly. Both now 100%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but does not touch CHANGELOG.md.

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a line under ## Unreleased. If it is a refactor, a
test-only change, or dependency churn, no entry is needed and you can
ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 28, 2026
@kubestellar-hive kubestellar-hive Bot added quality testing agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI labels Aug 28, 2026
@clubanderson clubanderson removed the hold label Aug 29, 2026
@clubanderson
clubanderson merged commit 4bdb090 into v4 Aug 29, 2026
51 of 52 checks passed
@clubanderson
clubanderson deleted the quality/test-mint-tokenreview-loader branch August 29, 2026 02:15
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI quality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant